<template>
	<view>
		<tt-bar title="名师列表" leftIcon="icon-back"></tt-bar>
		<view class="listBox">
			<block v-for="(item,index) in tcList">
				<teacherItem :tcItem="item" :key="index"></teacherItem>
			</block>
		</view>
	</view>
</template>

<script>
	import teacherItem from "@/components/teacherList/teacherItem.vue";
	export default {
		components:{
			teacherItem
		},
		data() {
			return {
				sid:0,
				tcList:[]
			};
		},
		methods:{
			getData(){
				this.$store.dispatch("apiGetTeacherList",{
					storeId:this.sid
				}).then(res=>{
					this.tcList=res.data.data.items
				})
			}
		},
		onLoad(cfm) {
			this.sid=cfm.id
			this.getData()
		},
		onPullDownRefresh() {
			setTimeout(() => {
				this.getData();
				uni.stopPullDownRefresh();
			}, 1500)
		}
	}
</script>

<style lang="less">
	page{
		background-color: #f6f6f6;
	}
	.listBox{
		display: flex;
		flex-direction: column;
		padding: 20upx 16upx;
	}
</style>
